class ArticleDataModel {
  ArticleDataModel({
    required this.id,
    required this.cateTitle,
    required this.articleCateId,
    required this.image,
    required this.title,
    required this.describe,
    required this.content,
    required this.name,
    required this.avatar,
    required this.grade,
    required this.like,
    required this.collect,
    required this.createTime,
    required this.comment,
    required this.videoId,
  });
  late final int id;
  late final String cateTitle;
  late final int articleCateId;
  late final String image;
  late final String title;
  late final String describe;
  late final String content;
  late final String name;
  late final String avatar;
  late final int grade;
  late final int like;
  late final int collect;
  late final String createTime;
  late final int comment;
  late final int videoId;

  ArticleDataModel.fromJson(Map<String, dynamic> json){
    id = json['id'];
    cateTitle = json['cate_title'];
    articleCateId = json['article_cate_id'];
    image = json['image'];
    title = json['title'];
    describe = json['describe'];
    content = json['content'];
    name = json['name'];
    avatar = json['avatar'];
    grade = json['grade'];
    like = json['like'];
    collect = json['collect'];
    createTime = json['create_time'];
    comment = json['comment'];
    videoId = json['video_id'];
  }

  static List<ArticleDataModel> fromList(List json){
    return List.from(json).map((e) => ArticleDataModel.fromJson(e)).toList();
  }

  Map<String, dynamic> toJson() {
    final _data = <String, dynamic>{};
    _data['id'] = id;
    _data['cate_title'] = cateTitle;
    _data['article_cate_id'] = articleCateId;
    _data['image'] = image;
    _data['title'] = title;
    _data['describe'] = describe;
    _data['content'] = content;
    _data['name'] = name;
    _data['avatar'] = avatar;
    _data['grade'] = grade;
    _data['like'] = like;
    _data['collect'] = collect;
    _data['create_time'] = createTime;
    _data['comment'] = comment;
    _data['video_id'] = videoId;
    return _data;
  }
}